package headfirst.combined.djview;

public class RPMController{
	RPMModelInterface model;     //object heart
	RPMView view;
	
	public RPMController(RPMModelInterface model) {
		this.model = model;
		view = new RPMView(this, this.model);
        view.createView();
        view.createControls();
		view.disableStopMenuItem();
		view.disableStartMenuItem();
		model.initialize();
	}
  
	public void start() {
		model.on();
		view.disableStartMenuItem();
		view.enableStopMenuItem();
	}
  
	public void stop() {
		model.off();
		view.disableStopMenuItem();
		view.enableStartMenuItem();
	}
    
	public void increaseRPM() {
        model.acelerar();
	}
    
	public void decreaseRPM() {
        model.desacelerar();
	}
}